import * as types from '../mutation-types'
import taskService from 'service/taskService.js'

const state = {
    untreatedNum: "",

}

const getters = {
    untreatedNum: () => state.untreatedNum,


}
const actions = {
    //待处理工单
    async getuntreatedNum({ commit }, handlerId) {
        if (!handlerId) {
            return false
        }
        let dataObj = {
            "page": 0,
            "size": 10000,
        }
        let untreated = await taskService.taskUntreatedList(dataObj, handlerId)
        if (untreated.data) {
            commit(types.UNTREATED_TASK, untreated.data.totalElements)
        }

    },
    changeuntreatedNum({ commit }, Num) {
        commit(types.UNTREATED_TASK, Num)
    }
}
const mutations = {
    [types.UNTREATED_TASK](state, untreatedNum) {
        state.untreatedNum = untreatedNum
    }

}
export default {
    state,
    getters,
    actions,
    mutations
}